Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial support for quantized transpose convolution in Relay #6899

Merged
merged 3 commits into from
Nov 26, 2020

Conversation

giuseros
Copy link
Contributor

This work is based on @jainris initial PR: #6523

I added a relay.qnn.conv2d_transpose node. The strategy I followed is to
convert to int16 and invoke nn.conv2d_transpose (which already exists in
relay). Main changes:

  • The node declaration lives in relay/qnn/op/convolution_transpose.cc
  • Cast int8->int16 and subsequent offset removal is in tvm/relay/qnn/op/legalizations.py.
  • I added and tested the operator in the tflite front-end
  • I added a unit-test in Relay for qnn.conv2d_transpose

This work is based on @jainris initial PR: apache#6523

I added a relay.qnn.conv2d_transpose node. The strategy I followed is to
convert to int16 and invoke nn.conv2d_transpose (which already exists in
relay). Main changes:

- The node declaration lives in relay/qnn/op/convolution_transpose.cc
- Cast int8->int16 and subsequent offset removal is in tvm/relay/qnn/op/legalizations.py.
- I added and tested the operator in the tflite front-end
- I added a unit-test in Relay for qnn.conv2d_transpose

Co-authored-by: Rishabh Jain <jainris@users.noreply.github.com>
@giuseros
Copy link
Contributor Author

cc @anijain2305 @u99127

python/tvm/relay/qnn/op/legalizations.py Outdated Show resolved Hide resolved
python/tvm/relay/qnn/op/legalizations.py Outdated Show resolved Hide resolved
python/tvm/relay/qnn/op/qnn.py Show resolved Hide resolved
python/tvm/relay/qnn/op/qnn.py Outdated Show resolved Hide resolved
python/tvm/relay/qnn/op/qnn.py Outdated Show resolved Hide resolved
python/tvm/relay/qnn/op/qnn.py Outdated Show resolved Hide resolved
src/relay/qnn/op/convolution_transpose.cc Outdated Show resolved Hide resolved
src/relay/qnn/op/convolution_transpose.cc Outdated Show resolved Hide resolved
tests/python/frontend/tflite/test_forward.py Show resolved Hide resolved
@mbaret mbaret self-assigned this Nov 23, 2020
@mbaret
Copy link
Contributor

mbaret commented Nov 23, 2020

cc @siju-samuel @FrozenGene if you're interested

Copy link
Contributor

@mbaret mbaret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mbaret mbaret merged commit 093629c into apache:main Nov 26, 2020
@mbaret
Copy link
Contributor

mbaret commented Nov 26, 2020

Thanks @giuseros and @jainris !

trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Dec 2, 2020
…che#6899)

* Add initial support for quantized transpose convolution in Relay

This work is based on @jainris initial PR: apache#6523

I added a relay.qnn.conv2d_transpose node. The strategy I followed is to
convert to int16 and invoke nn.conv2d_transpose (which already exists in
relay). Main changes:

- The node declaration lives in relay/qnn/op/convolution_transpose.cc
- Cast int8->int16 and subsequent offset removal is in tvm/relay/qnn/op/legalizations.py.
- I added and tested the operator in the tflite front-end
- I added a unit-test in Relay for qnn.conv2d_transpose

Co-authored-by: Rishabh Jain <jainris@users.noreply.github.com>

* Fix linting

* Addressing review comments

Co-authored-by: Rishabh Jain <jainris@users.noreply.github.com>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Dec 4, 2020
…che#6899)

* Add initial support for quantized transpose convolution in Relay

This work is based on @jainris initial PR: apache#6523

I added a relay.qnn.conv2d_transpose node. The strategy I followed is to
convert to int16 and invoke nn.conv2d_transpose (which already exists in
relay). Main changes:

- The node declaration lives in relay/qnn/op/convolution_transpose.cc
- Cast int8->int16 and subsequent offset removal is in tvm/relay/qnn/op/legalizations.py.
- I added and tested the operator in the tflite front-end
- I added a unit-test in Relay for qnn.conv2d_transpose

Co-authored-by: Rishabh Jain <jainris@users.noreply.github.com>

* Fix linting

* Addressing review comments

Co-authored-by: Rishabh Jain <jainris@users.noreply.github.com>
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Dec 4, 2020
…che#6899)

* Add initial support for quantized transpose convolution in Relay

This work is based on @jainris initial PR: apache#6523

I added a relay.qnn.conv2d_transpose node. The strategy I followed is to
convert to int16 and invoke nn.conv2d_transpose (which already exists in
relay). Main changes:

- The node declaration lives in relay/qnn/op/convolution_transpose.cc
- Cast int8->int16 and subsequent offset removal is in tvm/relay/qnn/op/legalizations.py.
- I added and tested the operator in the tflite front-end
- I added a unit-test in Relay for qnn.conv2d_transpose

Co-authored-by: Rishabh Jain <jainris@users.noreply.github.com>

* Fix linting

* Addressing review comments

Co-authored-by: Rishabh Jain <jainris@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants